package com.sudoku.register.daoImp;

import org.apache.commons.lang.StringUtils;

import com.common.dao.BaseDao;
import com.common.dao.BaseDaoImp;
import com.pojo.Sudokuer;
import com.sudoku.register.RegisterDao;

public class RegisterDaoImp extends BaseDaoImp implements RegisterDao{


	public int hasSameName(String rname) {
		Integer count = new Integer(1);
		if(StringUtils.isNotBlank(rname)) {
			
			count = (Integer)smct.queryForObject("hasSameName",rname);
			logger.debug("--"+rname+"--has been used by "+count.intValue()+" people");
		}
		return count.intValue();
	}
	
	public void registerSudokuer(Sudokuer su){
		if(su != null) {
			smct.insert("register",su);
		}else {
			logger.info("Sudokuer is null");
		}
	}
}
